<script>
	import {
		mapState,
		mapActions
	} from "vuex";
	export default {
		computed: {
			...mapState(['longitude', 'latitude'])
		},
		onLaunch: function() {
			uni.clearStorageSync()
			if (process.env.NODE_ENV === 'development') {
				// uni.removeStorageSync('token')
				//  18888888888
				uni.setStorageSync('token', '9ba67df5149a4bd28878a5f7c6fdf470'); 
				// 1995376688  
				// uni.setStorageSync('token', '3d4650904e984b26823b3f1f6dac6506'); 
			
				// 正式 1995376688
				// uni.setStorageSync('token', 'dbb8c34ff7cd4840a7754c51a4b94b92'); 
			} else {
				console.log('生产环境')
			}
			// 向宿主App发送事件
			uni.sendNativeEvent('infoUser', {
				msg: 'unimp message!!!'
			}, ret => {
				ret = JSON.parse(ret)
				let token = ret.token;
				uni.setStorageSync('token', token)
			})
			uni.getLocation({
				type: 'wgs84',
				success: (res) => {
					this.$store.commit("setlongitude", res.longitude);
					this.$store.commit("setlatitude", res.latitude);
				}
			});
		},
		onShow: function() { 
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>

<style lang="scss">
	/* #ifndef APP-PLUS-NVUE */
	@import "uview-ui/index.scss";
	@import 'static/initLess/index';  
	/* #endif */

	/*每个页面公共css */
</style>
